package com.lhd.shop.controller;

import com.lhd.shop.service.FrontService;
import dto.UserInfoDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import service.FrontDeskService;
import utils.Base64Utils;
import vo.ResponseData;

/**
 * @program: sporadic
 * @description:
 * @author: LHD   QQ:1727865856
 * @create: 2019-11-12 11:50
 **/
@RestController
@RequestMapping("/shopservice")
@CrossOrigin
public class UserInfoController {

    @Autowired
    private FrontService frontService;
    @PostMapping("/userInfo")
    public ResponseData<String> login(@RequestBody UserInfoDTO userInfoDTO){
        return new ResponseData<>(frontService.jwtlogin(userInfoDTO));
    }

    @GetMapping("/base")
    public ResponseData<String> base(String user){
        return new ResponseData<>(Base64Utils.base64Decode(user));
    }
}
